#ifndef SERIALDRIVER_H
#define SERIALDRIVER_H

#include <QSerialPort>
#include <QSerialPortInfo>
#include <QString>

class SerialDriver : public QObject
{
    Q_OBJECT
public:
    SerialDriver();
    virtual ~SerialDriver();

    QStringList scanSerial();
    void Debug();

    bool open(QString serialName, int baudRate = 9600);
    void writeData(const QByteArray &data);
    void readData();
    void close();

    QByteArray data;
    QSerialPort* m_serial = nullptr;
};

#endif // SERIALDRIVER_H
